package com.dong.dao;

import com.dong.entity.Project;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.FetchType;

public interface IProjectDao {
    @Select("select * from project where p_id=#{id}")
    @Results(id="pMap",value = {
            @Result(id=true,column = "p_id",property = "p_id"),
            @Result(column = "p_name",property = "p_name"),
            @Result(column = "p_date",property = "p_date"),
            @Result(property = "developers",column = "p_id",many = @Many(select = "com.dong.dao.IDeveloper.findDeveloperBypid",fetchType = FetchType.LAZY))
    })
    Project findByPid(int id);
}
